package com.ghost.Chessboard;

 
import java.util.HashMap;
 
import java.util.Map;

class Thisproperty
{
    public final static int AMOUNT=6;
    public boolean directionto=true; // mirror: true to left,false to right   
    public boolean seebyeye;
    public boolean seebymirror;
    public int id;
    public String name;
    public static int[] id_property ={0,1,2,3,4,5};
    public static boolean[] seebyeye_property = {false,false,false,true,false,true};
    public static boolean[] seebymirror_property = {false,false,false,false,true,true};
    public static boolean[] directionto_property = {false,true,false,false,false,false};
    public static final String[] NAMES = {"blank","mirror_toleft","mirror_toright","vampire","ghost","zombie"};
    
}
public class Item extends Thisproperty{
    private static final Map<String, Integer> NAMESMAP =new HashMap<String, Integer>(); 
     
//    private boolean seebyeye;
//    private boolean seebymirror;
    public Position position;
    
    static {
	for (Integer i =0;i<NAMES.length;i++){
	NAMESMAP.put(NAMES[i],id_property[i]);
	}
    }
 


//    private String name;
//    private int id;
    public Item(String name) {
	// TODO Auto-generated constructor stub
	this.name=name;
	this.id=NAMESMAP.get(name);
	setproperty(this.name);
	Pref.sysprint(" ###******** "+this.name+this.id);
    }
    public Item(int id) {
	// TODO Auto-generated constructor stub
	this.id=id;
	this.name=NAMES[id];
	setproperty(this.name);
	Pref.sysprint(" ###******** "+this.name+this.id);
	
    }
    public void setname(String name) {
    this.name=name;
    this.id=NAMESMAP.get(name);
    setproperty(this.name);
    }
    
    public void setid(int id) {
	    this.id=id;
	    this.name=NAMES[id];
	    setproperty(this.name);
	    }
    public String getname() {
	return this.name;
    }
    
    public int getid() {
	return id;
    }
    public void setproperty(String name) {
	for (int i =0;i<AMOUNT;i++){
	    	if (name==NAMES[i])
	    	{
	    	    this.directionto=directionto_property[i];
	    	    this.seebyeye=seebyeye_property[i];
	    	    
	    	Pref.sysprint("$$$$$$$$$$seebyeye: "+this.seebyeye);
	    	    this.seebymirror=seebymirror_property[i];
	    	Pref.sysprint("$$$$$$$$$$seebymirror: "+this.seebymirror);
	    	}
		}

    }
    public void setposition(int x,int y) {
	this.position=new Position(x,y);
	
    }
     
     
    
}


